//
//  UserDefined.h
//  AmountBody
//
//  Created by smm on 17/12/6.
//  Copyright (c) 2017年 RCMTM. All rights reserved.
//

#import <Foundation/Foundation.h>

#ifdef DEBUG
    #define NSLog(s,...) NSLog(@"%s LINE:%d < %@ >",__FUNCTION__, __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__])
#else
    #define NSLog(s,...) nil
#endif

//一个公共的用于处理解析数据的方法，过滤NSNull、nil、number、bool等类型转换成字符串
#define GlobalHandleValue(value)\
({id strValue;\
if (!value || [value isKindOfClass:[NSNull class]] || [value isKindOfClass:[NSDictionary class]] || [value isKindOfClass:[NSArray class]])\
strValue = @"";\
else \
strValue = [NSString stringWithFormat:@"%@", value];\
strValue;\
})


@interface UserDefined : NSObject
#pragma mark -- 网络请求相关
//网络请求相关
#define HTTP_HEADER @"http://wei.yhbin.cn"
//#define HTTP_HEADER @"http://weiyitui.junprivate.cn"



#define HTTP_AFNETWORKING_POST_URL @"index.php/app_wei"

#define HTTP_DEFAULT_RETURN_KEY @"datas" //网络请求返回数据结构默认key值

#define HTTP_HEADER_APPMOBILE [NSString stringWithFormat:@"%@/%@", HTTP_HEADER, HTTP_AFNETWORKING_POST_URL]

#define HTTP_HEADER_URL [NSString stringWithFormat:@"%@/", HTTP_HEADER_APPMOBILE]
//app版本
#define IosAppVersion ([[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"])
//appid
#define APPID @"12522266000"

//更新地址
#define DOWNLOADURL [NSString stringWithFormat:@"https://itunes.apple.com/us/app/推酷/id%@?l=zh&ls=1&mt=8", APPID]
#pragma mark--设备尺寸相关。。
//设备尺寸相关
#define DEVICE   ([[[UIDevice currentDevice]systemVersion]floatValue])
#define SCREEN_H ([[UIScreen mainScreen] bounds].size.height)
#define SCREEN_W ([[UIScreen mainScreen] bounds].size.width)

#define TOPNAVIGATIONBAR_H 64 //顶部navigation的高度
#define USERDEFINED_TABBAR_H 49    //tabbar每个按钮的高度
#define RefreshFooterHeight 60 //上拉刷新高度

#define PAGESIZE 10//每页数据条数

#pragma mark--颜色

#define RGBColor(r,g,b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define RGBColorAlpha(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]

//自定义tabbar相关
//navigationbar 的 title字体颜色
#define NAVIGATION_TITLE_COLOR [UIColor colorWithRed:85.0/255.0 green:85.0/255.0 blue:85.0/255.0 alpha:1]
//navigationbar 的 背景颜色
#define NAVIGATION_BAR_COLOR  [UIColor colorWithRed:250.0/255.0 green:250.0/255.0 blue:250.0/255.0 alpha:1]
//tabbar颜色
#define TAB_BAR_COLOR  [UIColor colorWithRed:246.0/255.0 green:246.0/255.0 blue:246.0/255.0 alpha:1]
//tabbar下方text正常情况下的字体颜色
#define TAB_BAR_TEXT_NORMAL_COLOR  [UIColor colorWithRed:154.0/255.0 green:154.0/255.0 blue:154.0/255.0 alpha:1]
//tabbar下方text选中情况下的字体颜色
#define TAB_BAR_TEXT_SELECTED_COLOR  [UIColor colorWithRed:255.0/255.0 green:101.0/255.0 blue:1.0/255.0 alpha:1]
#define RED_Color RGBColorAlpha(254, 152, 150, 1)
#define ZHU_Color RGBColorAlpha(32, 32, 32, 1)
//pagecontroll圆圈颜色
#define PAGE_while_COLOR  [UIColor colorWithRed:0.0/255.0 green:0.0/255.0 blue:0.0/255.0 alpha:1]
#define PAGE_while_Current_COLOR  [UIColor colorWithRed:205.0/255.0 green:205.0/255.0 blue:205.0/255.0 alpha:0.5]

#pragma mark--常用字体大小
//字体大小说明：除页面大标题 字体最大字号15，最小字号10。15和10一般不要使用，除非特殊情况
//正文字体高度及颜色
#define Nomal_Label_H 20//正常label高度
#define Button_Font [UIFont systemFontOfSize:14.0]//按钮的字体大小
#define ShenZi_Color  [UIColor colorWithRed:45.0/255.0 green:45.0/255.0 blue:45.0/255.0 alpha:1]//深字（标题）
#define ZhongZi_Color [UIColor colorWithRed:85.0/255.0 green:85.0/255.0 blue:85.0/255.0 alpha:1]//稍浅字（公司名称、介绍等）
#define QianZi_color [UIColor colorWithRed:155.0/255.0 green:155.0/255.0 blue:155.0/255.0 alpha:1]//浅字（时间等）
#define ShenLine_color RGBColorAlpha(205, 205, 205, 1)
#define Line_color RGBColorAlpha(235, 235, 235, 1)
//主要背景颜色（黑）
#define ZhuBack_color RGBColorAlpha(44, 44, 44, 1)
//页面大标题颜色

#define TiTleLabel_Font [UIFont systemFontOfSize:16.0]

//cell大标题（公司名等）
#define Cell_Big_Font [UIFont systemFontOfSize:15.0]
//cell中标题（文章名等）
#define Cell_Medium_Font [UIFont systemFontOfSize:14.0]
//cell小标题（介绍等）
#define Cell_Little_Font [UIFont systemFontOfSize:13.0]
//cell小标题（介绍等）
#define More_Little_Font [UIFont systemFontOfSize:12.0]


#pragma mark--- 默认图片
#define DEFAULT_HOMEAD_PHOTO_RECTANGLE @"600X200.png"    //广告位的默认图片(长方形)
#define DEFAULT_LIST_PHOTO @"300X200.png"    //列表的默认图片
#define DEFAULT_TongZhi_PHOTO @"650X190.png"    //通知的默认图片
#define DEFAULT_AD_PHOTO @"600X100.png"    //图片小助手广告的默认图片
#define DEFAULT_Mould_PHOTO @"600X100.3.png"    //模板图片的默认图片

#pragma mark---常用标记符或名称

#define RegularExpressionValidationTel @"^[0][1-9]{2,3}-[0-9]{5,8}$" //电话号码 格式021-68686868或0511-6868686

#define PHONENUMBER_REGEX @"^((13[0-9])|(15[0-9])|(18[0-9])|(14[0-9])|(17[0-9]))\\d{8}$"//手机号匹配
#define MemberNAME_REGEX @"^[A-Za-z0-9]+$"//匹配英文和数字

#define USERNAME_REGEX @"^([A-Za-z]{6,12})|((?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,12}$)" //用户名匹配（6-12位字母或数字加字母）
#define LOADINGTEXT @"loading..."//加载时显示的内容
#define PushNotifierName @"pushNotifier"//百度推送
//登录异常
#define HTTP_LOGIN_ABNORMAL_KEY @"login"
#define LOGIN_NOTIFICATION_NAME @"LoginNotificationName_iOS"
#define LOGIN_MEMBERCENTERAbnormal_NAME @"MemberCenterNotificationName_iOS"

//地址相关信息的更换条件 Address changing conditions
//每更换一次地址，该值+1
#define conditionOfTheAddressChanged @"1"

//单位尺度
#define UNITSCALELC [UIScreen mainScreen].bounds.size.width/1024.0
// 改写为弱引用
#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;


@end
